<!DOCTYPE html>
<title>pagereveal event fires and in correct order on new-document navigation</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering">
<link rel="author" href="mailto:bokan@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const event_log = [];

addEventListener('pageshow', () => event_log.push('pageshow'));
addEventListener('pagereveal', () => event_log.push('pagereveal'));
requestAnimationFrame(() => event_log.push('rAF'));

promise_test(async () => {
  await new Promise(resolve => requestAnimationFrame(resolve));
  assert_equals(event_log.toString(),'pageshow,pagereveal,rAF');
});
</script>
